<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <#include "../decorator/head.html"/>
    <title>${applicationName}-字典配置</title>
</head>
<body>
<div class="row">
<div class="col-md-6">
    <!-- 查询表单 -->
    <div id="data-search">
        <h5>字典配置</h5>
        <!-- 业务内容 -->
        <form method="GET" id="search-form" class="form-inline form-search">
                <label class="col-sm-3">字典名称</label>
                <input type="text" name="name" placeholder="字典名称" style="max-width:200px;">
                <label class="col-sm-3">字典描述</label>
                <input type="text" name="description" placeholder="字典描述" style="max-width:200px;">

                <button type="submit" _func="query" class="btn btn-info">查询</button>
                <@shiro.hasPermission name="sys:sys_dict:add">
                <button type="button" _func="add" class="btn btn-success">增加</button>
                </@shiro.hasPermission>
        </form>
    </div>
    <!-- table -->
    <div id="data-list"></div>
    <!-- dialog -->
    <div id="data-dialog"> </div>
</div>

<!-- 明细 -->
<div class="col-md-5">
    <!-- 查询表单 -->
    <div id="data-search2">
        <h5 style="background-image:linear-gradient(to right,#10ff10, #8fff8f,#fefffe);">
            字典明细(请点击左侧列表字典项)
        </h5>
        <!-- 业务内容 -->
        <form method="post" class="form-inline form-search">
            <label>字典标签</label>
            <input type="text" name="label" placeholder="标签名称" class="col-sm-8">&nbsp;&nbsp;
            <button type="submit" _func="query" class="btn btn-sm btn-primary">查询</button>
            <@shiro.hasPermission name="sys:sys_dict:add">
            <button type="button" _func="add" class="btn btn-sm btn-success">增加</button>
            </@shiro.hasPermission>
        </form>
    </div>
    <!-- table -->
    <div id="data-list2"></div>
    <!-- dialog -->
    <div id="data-dialog2"> </div>
</div>
</div>
</body>
<#include "../decorator/foot.html"/>
<script type="text/cc-template" id="template-data-list">
<!--    <table class="table table-striped table-bordered table-condensed">-->
    <table class="table">
        <thead class="table-dark">
        <tr>
            <th>字典ID</th>
            <th>字典名称</th>
            <th>字典描述</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {{#each data}}
        <tr>
            <td func="show_detail" title="创建人:{{create_by}}&#10;更新人:{{update_by}}&#10;创建时间:{{create_time}}&#10;更新时间:{{update_time}}">
                {{id}}
            </td>
            <td func="show_detail" style="font-size:12pt;color:red;" title="点击字典项{{name}}右侧展开字典明细">{{name}}</td>
            <td func="show_detail">{{description}}</td>
            <td>
                <@shiro.hasPermission name="sys:sys_dict:update">
                <a href="#" func="update">修改</a>
                </@shiro.hasPermission>
                <@shiro.hasPermission name="sys:sys_dict:delete">
                <a href="#" func="delete">删除</a>
                </@shiro.hasPermission>
            </td>
        </tr>
        {{/each}}
        </tbody>
    </table>
<#include "../decorator/page-form.html"/>
<#--<#include "../decorator/page-form_short.html"/>-->
</script>

<!-- 字典明细项 -->
<script type="text/cc-template" id="template-data-list2">
    <table class="table table-striped table-bordered table-condensed">
        <thead class="table-dark">
        <tr>
<!--            <th>标签ID</th>-->
            <th>标签</th>
            <th>值</th>
            <th>排序</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {{#each data}}
        <tr>
<!--            <td title="创建人:{{create_by}}&#10;更新人:{{update_by}}&#10;创建时间:{{create_time}}&#10;更新时间:{{update_time}}">-->
<!--                {{id}}-->
<!--            </td>-->
            <td title="id:{{id}}&#10;创建人:{{create_by}}&#10;更新人:{{update_by}}&#10;创建时间:{{create_time}}&#10;更新时间:{{update_time}} {{label}}">
                {{label}}
            </td>
            <td>{{value}}</td>
            <td>{{dict_sort}}</td>
            <td>
                <@shiro.hasPermission name="sys:sys_dict:update">
                <a href="#" func="update">修改</a>
                </@shiro.hasPermission>
                <@shiro.hasPermission name="sys:sys_dict:delete">
                <a href="#" func="delete">删除</a>
                </@shiro.hasPermission>
            </td>
        </tr>
        {{/each}}
        </tbody>
    </table>
    <#include "../decorator/page-form_short.html"/>
</script>

<script type="module">
    import {init} from "${ctxPath}/public/sys/sys_dict.js"
    // 执行初始化方法
    init();
</script>
<style>
table tbody tr:hover,table tbody tr:nth-child(even):hover{
  background-color:rgb(207, 255, 207);
}
</style>
</html>
